const { app, BrowserWindow} = require('electron');

let mainWindow = null;

app.on('ready', () => {
    mainWindow = new BrowserWindow({
        width: 900, height: 600,
        /* enable nodejs in rendering thread */
        webPreferences: { nodeIntegration: true, contextIsolation: false},
        titleBarStyle: 'hidden',
        /* button's style of `- ▢ x` */
        titleBarOverlay: { color: '#323233', symbolColor: '#ffffff', height: 30 },
        minWidth: 900,
        minHeight: 600
    });
    mainWindow.loadFile('home/home.html');
    mainWindow.on('closed', () => { mainWindow = null});
});

/* Ignore the SSL (of HTTPS) */
app.commandLine.appendSwitch('ignore-certificate-errors');
